package utils

import (
	"context"
	"github.com/gogf/gf/v2/net/ghttp"
	"github.com/mileusna/useragent"
)

// UserAgent 请求头user-agent
func UserAgent(ctx context.Context) useragent.UserAgent {
	uaString := ghttp.RequestFromCtx(ctx).UserAgent()
	return useragent.Parse(uaString)
}
